<!-- cj -->
<!DOCTYPE html>
<!--suppress ALL -->
<html lang="zh-CN" xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>$Title$</title>
    <head th:include="/utils/common_css :: commonCss"></head>
    <!--<link th:href="@{/static/css/datatables.bundle.css}" rel="stylesheet" type="text/css"/>-->
    <link th:href="@{/static/css/data_table.css}" rel="stylesheet" type="text/css"/>
</head>
<body class="m-page--fluid m--skin- m-content--skin-light2 m-header--fixed m-header--fixed-mobile m-aside-left--enabled m-aside-left--skin-dark m-aside-left--offcanvas m-footer--push m-aside--offcanvas-default">
<div class="m-grid m-grid--hor m-grid--root m-page">
    <div th:replace="/utils/header :: header"></div>
    <div class="m-grid__item m-grid__item--fluid m-grid m-grid--ver-desktop m-grid--desktop m-body">
        <div th:replace="/utils/left_menu :: leftMenu"></div>
        <div class="cj-main">
            <div class="cj-main-header">
                <ul>
                    <li class="icon">
                        <i class="m-nav__link-icon la la-home"></i>
                    </li>
                    <li>
                        <a class="decoration">系统设置</a>
                    </li>
                    <li>
                        <a class="decoration" href="/admin/sys/permission">权限菜单展示</a>
                    </li>
                </ul>
            </div>
            <div class="cj-main-content">
                <!-- 数据展示 -->
                <div class="cj-m-c-data">
                    <!-- 数据表格展示 -->
                    <div class="data-table">
                        <table>
                            <thead>
                                <tr>
                                    <th class="data-table-code">菜单编号</th>
                                    <th class="data-table-name">菜单名称</th>
                                    <th class="data-table-date">排序</th>
                                    <th class="data-table-content">父菜单名称</th>
                                    <th class="data-table-content">url</th>
                                    <th class="data-table-state">状态</th>
                                    <th class="data-table-state">类型</th>
                                </tr>
                            </thead>
                            <tbody id="dataTableRows">

                            </tbody>
                        </table>
                    </div>
                    <!-- 分页展示 -->
                    <div class="data-page dataTables_paginate paging_simple_numbers">
                        <div class="data-page-content" id="rowCount">

                        </div>
                        <div class="data-page-number">
                            <ul class="pagination" id="pageNumber">
                            </ul>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<div th:include="/utils/common_js :: commonJS"></div>
<script th:src="@{/static/js/utils.js}" type="text/javascript"></script>
<script th:src="@{/static/js/ajax.js}" type="text/javascript"></script>
<script th:src="@{/static/js/page.js}" type="text/javascript"></script>
<script>

    window.onload = ajaxLoadDateTabel();

    var key = ["id", "name", "seq", "parentName","url","state","isMenu"];

    function ajaxLoadDateTabel(index) {
        var index = index || 1;
        empty();
        postAjax('/admin/sys/permissions',
            { "index": index},
            function (result) {
                if(result.code===1){
                    pageCount(index,result.data,key,null,"isMenu",function(isMenu) {
                        if(isMenu===1){
                            return '<td><span class="m-badge m-badge--danger m-badge--dot"></span>&nbsp;<span class="m--font-bold m--font-danger">功能菜单</span></td>';
                        }
                        return '<td><span class="m-badge m-badge--primary m-badge--dot"></span>&nbsp;<span class="m--font-bold m--font-primary">显示菜单</span></td>' ;

                    },"url",function (url) {
                        if(url!=null&&url!==""){
                            return '<td><a href="'+url+'" class="btn btn-outline-success m-btn m-btn--icon m-btn--icon-only"><i class="fa fa-globe"></i></a></td>';
                        }
                        return '<td><a href="#" class="btn btn-outline-metal m-btn m-btn--icon m-btn--icon-only"><i class="fa fa-tint"></i></a></td>';
                    });
                }
            });
    }

</script>
</body>
</html>